<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title> 下载测试用例 </title>
</head>
<body>
<?php require("front_view_nav.php"); ?>
<div class="container">
    <center><button style="margin-top: 10rem;" onclick="goBack()">点此返回</button></center>
</div>

<script>
    var problemId = getUrlKey('problemid');
    var fileName = getUrlKey('filename');

    var checkReqData = {
        op:"check",
        problemid:problemId,
        filename:fileName
    };
    var param = "para="+JSON.stringify(checkReqData);

    $.ajax({
        type:'post',
        url:'../model/test_data_router.php',
        data:param,
        dataType:'json',
        success:function (retData) {
            if ( retData.status ) {
                var downReqData = {
                    op:"down",
                    problemid:problemId,
                    filename:fileName
                };
                var url = "../model/test_data_router.php?para="+JSON.stringify(downReqData);
                window.location.href=url;
            }
            else {
                alert('操作错误：'+retData.msg);
            }
        }
    });
    
    function goBack() {
        window.history.go(-1);
    }
</script>
</body>
</html>
<?php
//require("../oj-footer.php");
?>